package com.copro.chemdb.search;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import com.copro.chemdb.result.Result;

public class SearchResult {

	public SearchResult(ResultSet rs) throws SQLException {
		resultId = rs.getInt("resultId");
		brief = rs.getString("brief");
		quesId = rs.getInt("quesId");
		parentId = rs.getInt("parentId");
		question = rs.getString("question");
		answer = rs.getString("answer");
		this.createTime = new Date(rs.getTimestamp("createTime").getTime());
	}

	private int resultId;
	private String brief;
	private int quesId;
	private String question;
	private Date createTime;
	private String answer;
	private int parentId;
	private Result parent;

	public Result getParent() {
		return parent;
	}

	public void setParent(Result parent) {
		this.parent = parent;
	}

	public int getParentId() {
		return parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	public int getQuesId() {
		return quesId;
	}

	public void setQuesId(int quesId) {
		this.quesId = quesId;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public SearchResult() {
	}

	public int getResultId() {
		return resultId;
	}

	public void setResultId(int resultId) {
		this.resultId = resultId;
	}

	public String getBrief() {
		return brief;
	}

	public void setBrief(String brief) {
		this.brief = brief;
	}

	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

}
